Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

string.prototype.matchall

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

string.prototype.matchall

Spec-compliant polyfill for String.prototype.matchAll ESnext proposal.

  • 3.0.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
18M
decreased by-4.36%
Maintainers
2
Weekly downloads
 
Created

What is string.prototype.matchall?

The string.prototype.matchall npm package is a polyfill for the `String.prototype.matchAll` method, which returns an iterator of all results matching a string against a regular expression, including capturing groups. This package is particularly useful for environments that do not yet support the `matchAll` method natively.

What are string.prototype.matchall's main functionalities?

Matching all occurrences of a pattern

This feature allows you to find all occurrences of the pattern `/test/g` in the string `"test1test2"`. It returns an iterator that contains all matches.

"test1test2".matchAll(/test/g)

Capturing groups in matches

This demonstrates how to use capturing groups with `matchAll`. The regular expression `/(te)(st\d)/g` includes two capturing groups that match parts of the string. The result is an iterator of matches, where each match includes the full matched text and the text matched by each capturing group.

"test1test2".matchAll(/(te)(st\d)/g)

Other packages similar to string.prototype.matchall

Keywords

FAQs

Package last updated on 02 Oct 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc